home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Topik / Topik - Disk 02 - Fonts and CLI Commands (19xx)(Topik Public Domain)(PD)[a][WB].zip / Topik - Disk 02 - Fonts and CLI Commands (19xx)(Topik Public Domain)(PD)[a][WB].adf / Source / Turbo.c < prev   
C/C++ Source or Header  |  1989-04-19  |  2KB  |  133 lines

  1. /* TURBO
  2.    -----
  3.    Improves system speed 
  4.    by turning of bitplane,
  5.    sprite, copper and 
  6.    audio DMA.
  7.    (W) 6/88 by O.Wagner
  8.  
  9.    V1.0 for MANX Aztec C 3.4a
  10.    CC turbo
  11.    LN turbo.o -lc
  12.  
  13.    To install, enter "RUN TURBO".
  14.    Pressing the "TURBO!"-gadget
  15.    will turn off screen and all.
  16.    Pressing button outside of the
  17.    "TURBO"-window, pressing RIGHT
  18.    button or the "TURBO"-window
  19.    becoming inactive (by starting
  20.    another application) will turn
  21.    BITPLANE, COPPER and SPRITE.
  22.    AUDIO must be turned on manually.
  23.  
  24.    This is Public Domain. 
  25.    Please note that some other
  26.    programs of the author are
  27.    shareware and NOT freely 
  28.    distributable. */
  29.  
  30. #include <hardware/dmabits.h>
  31. #include <hardware/custom.h>
  32. #include <intuition/intuition.h
  33.  
  34. /* window created with POWERWINDOWS */
  35.  
  36. SHORT BorderVectors1[] = {0,0,74,0,74,12,0,12,0,0};
  37. struct Border Border1 = {
  38.     -2,-1,
  39.     2,0,JAM1,
  40.     5,
  41.     BorderVectors1,
  42.     NULL
  43. };
  44.  
  45. struct TextAttr TOPAZ80 = {
  46.     (STRPTR)"topaz.font",
  47.     TOPAZ_EIGHTY,0,0
  48. };
  49. struct IntuiText IText1 = {
  50.     3,0,JAM2,
  51.     11,2,
  52.     &TOPAZ80,
  53.     (STRPTR)"TURBO!",
  54.     NULL
  55. };
  56.  
  57. struct Gadget gadget = {
  58.     NULL,
  59.     13,12,
  60.     71,11,
  61.     GADGHCOMP,
  62.     RELVERIFY,
  63.     BOOLGADGET,
  64.     (APTR)&Border1,
  65.     NULL,
  66.     &IText1,
  67.     0,
  68.     NULL,
  69.     4,
  70.     NULL
  71. };
  72.  
  73.  
  74. struct NewWindow NewWindowStructure = {
  75.     0,0,
  76.     96,26,
  77.     3,2,
  78.     CLOSEWINDOW+GADGETUP+INACTIVEWINDOW+MOUSEBUTTONS,
  79.     WINDOWDRAG+WINDOWDEPTH+WINDOWCLOSE+SIMPLE_REFRESH+RMBTRAP+NOCAREREFRESH,
  80.     &gadget,
  81.     NULL,
  82.     NULL,
  83.     NULL,
  84.     NULL,
  85.     0,0,
  86.     0,0,
  87.     WBENCHSCREEN
  88. };
  89.  
  90. struct IntuitionBase *IntuitionBase,*OldOpenLibrary();
  91. struct Window *OpenWindow();
  92. struct IntuiMessage *GetMsg();
  93.  
  94. main()
  95. {
  96.  register int class;
  97.  register struct Window *win;
  98.  register struct IntuiMessage *msg;
  99.  
  100.  IntuitionBase=OldOpenLibrary("intuition.library");
  101.  if (!(win=OpenWindow(&NewWindowStructure)))
  102.   { DisplayBeep(0); Exit(20); }
  103.  
  104.  for(;;) { /* FOREVER */
  105.   Wait(1L<<win->UserPort->mp_SigBit);
  106.   while(msg=GetMsg(win->UserPort)) {
  107.    class=msg->Class;
  108.    ReplyMsg(msg);
  109.    switch(class) {
  110.     case CLOSEWINDOW:
  111.      CloseWindow(win); /* cleanup */
  112.      Exit(0);
  113.     case GADGETUP:
  114.      custom.dmacon = BITCLR+DMAF_RASTER+DMAF_COPPER+DMAF_SPRITE+DMAF_AUDIO;   
  115. /* nice hint how to use CUSTOM.H to simply access the custom board */
  116.      break;
  117.     default:
  118.      custom.dmacon = BITSET+DMAF_RASTER+DMAF_COPPER+DMAF_SPRITE;
  119.      break;
  120.    }
  121.   }
  122.  }
  123. }    
  124.    
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.